package collection;

import java.util.LinkedList;

public class LinkedListDemo {
    public static void main(String[] args) {
        LinkedList<Integer> list = new LinkedList<>();
        list.add(100);
        list.add(200);
        list.add(300);
        list.addFirst(50);
        list.addLast(400);
        System.out.println("list:"+list);
        System.out.println("首部元素："+list.getFirst());
        System.out.println("尾部元素："+list.getLast());
    }
}
